{% load widget_tweaks %}

{% if form.non_field_errors %}
<div class="alert alert-warning alert-dismissible fade in" role="alert">
          <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span>
          </button>
    {% for error in form.non_field_errors %} {{ error }} {% endfor %}
</div>
{% endif %}

{% for hidden_field in form.hidden_fields %} {{ hidden_field }} {% endfor %}
{% for field in form.visible_fields %}

      <div class="form-group{% if field.errors %} invalid{% endif %}">
            {{ field.label_tag }}
             {% render_field field class="form-control"%}
              {% if field.help_text %}
                  <small class="form-text text-muted">{{ field.help_text }}</small>
            {% endif %}
              {% for error in field.errors %}
              <p class="text-danger small">{{ error }}</p>
            {% endfor %}
        </div>
{% endfor %}

